#ifndef _CLIENT_
#define _CLIENT_
#include <my_header.h>
#include "transFile.h"
#include "thread.h"
#define THRESHOLD 104857600

enum{
    CD,
    LS,
    PWD,
    MKDIR,
    RMDIR,
    GETS,
    PUTS,
    FILENAME,
    FILESIZE,
    FILEDATA,
    FILEEND,
    REMOVE,
    QUIT,
    LOGIN,
    USRNAME,
    ENCRYPTED,
    QUERY,
    TOKEN
};

int putFile(char* fileName, int netfd);

int getFile(int netfd);

int commandToken(char* buf, train_t* train);

int getMsg(char* usrname, char* password);

int login(int netfd,char* usrname,char* password);

#define LOG_ERROR_CHECK(ret,error_flag,msg) \
    do{\
        if((ret) == (error_flag)){\
            syslog(LOG_INFO,msg);\
        }\
    }while(0)
#endif
